import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../layout/Layout.vue'

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect: "/info",
    children: [
      {
        path: 'info',
        name: 'Info',
        component: () => import("@/views/Info"),
      },
      {
        path: 'user',
        name: 'User',
        component: () => import("@/views/User"),
      },
      {
        path: 'member',
        name: 'Member',
        component: () => import("@/views/Member"),
      },
      {
        path: 'coachInfo',
        name: 'CoachInfo',
        component: () => import("@/views/CoachInfo"),
      },
      {
        path: '/person',
        name: 'Person',
        component: ()=>import("@/views/Person")
      },
      {
        path: '/equipment',
        name: 'Equipment',
        component: ()=>import("@/views/Equipment")
      },
      {
        path: '/memberVip',
        name: 'MemberVip',
        component: ()=>import("@/views/MemberVip")
      },
      {
        path: '/course',
        name: 'Course',
        component: ()=>import("@/views/Course")
      },
      {
        path: '/coach',
        name: 'Coach',
        component: ()=>import("@/views/Coach")
      },
      {
        path: '/courseBuy',
        name: 'CourseBuy',
        component: ()=>import("@/views/CourseBuy")
      },
      {
        path: '/coachBuy',
        name: 'CoachBuy',
        component: ()=>import("@/views/CoachBuy")
      },
      {
        path: '/consumRecord',
        name: 'ConsumRecord',
        component: ()=>import("@/views/ConsumRecord")
      },
      {
        path: '/coursePlan',
        name: 'CoursePlan',
        component: ()=>import("@/views/CoursePlan")
      },
      {
        path: '/studentInfo',
        name: 'StudentInfo',
        component: ()=>import("@/views/StudentInfo")
      },
      {
        path: '/leave',
        name: 'Leave',
        component: ()=>import("@/views/Leave")
      },
      {
        path: '/approveLeave',
        name: 'ApproveLeave',
        component: ()=>import("@/views/ApproveLeave")
      },
      {
        path: '/courseOrder',
        name: 'CourseOrder',
        component: ()=>import("@/views/CourseOrder")
      },
      {
        path: '/news',
        name: 'News',
        component: ()=>import("@/views/News")
      },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: ()=>import("@/views/Login")
  },
  {
    path: '/register',
    name: 'Register',
    component: ()=>import("@/views/Register")
  },

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
